from exceldic_test import Config_Dict
from exceldic_test import process_excel_data
import sys
from PySide6.QtCore import QCoreApplication, QByteArray
from dataprocessor import ScreenDataProcessor


# 假设excel_file_path是正确的Excel文件路径
#configfile_path = r'D:\keytest2.xlsx'
#keywords_test ="OSHWHub-fangda"
DataProcessorInstance = ScreenDataProcessor()

def Processor_Interface(recieved_rawdata):
    keywords = recieved_rawdata
    tuple_data = process_excel_data(keywords, Config_Dict)
   # print(
   #    f"功能码: {tuple_data[0]}, 操作2: {tuple_data[1]}, 数据量N: {tuple_data[2]}, 参数1: {tuple_data[3]}, 参数2: {tuple_data[4]}, 参数3: {tuple_data[5]}")
    funccode_str = tuple_data[0]
    param1_str = tuple_data[3]
    DataProcessorInstance.execute_statemachine(funccode_str, param1_str)
    UI_update_str='数据:'+keywords+'   按下:'+param1_str
    return UI_update_str
    # qt_dataupdate
#给我写一个结构体，{字符串，int，int，字符串，字符串，字符串}